package com.tencent.iov.cowin.befsale.clue.dao.cus;

import com.github.pagehelper.Page;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.request.CusUnbindRequest;
import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.response.CusUnbindResponse;
import com.tencent.iov.cowin.befsale.clue.controller.cus.vo.request.ClueIntentionGradeDataRequest;
import com.tencent.iov.cowin.befsale.clue.controller.cus.vo.request.QueryCustomerRequest;
import com.tencent.iov.cowin.befsale.clue.domain.cus.po.DealerCustomer;
import com.software.boot.dao.annotation.MyBatisRepository;
import com.software.boot.dao.common.BaseDao;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

/**
 * @Describe: 经销商客户表主表+客户好友关联表_Dao接口层
 * @author: xiamu
 * @created: 2021-12-21 17:29:50
 * @version: 1.0
 */
@MyBatisRepository
public interface DealerCustomerDao extends BaseDao<DealerCustomer> {

    /**
     * 通过ID获取详细信息
     *
     * @param: id 主键ID
     * @return: DealerCustomer对象
     */
    DealerCustomer getDetailById(Long id);

    /**
     * 单条数据插入DealerCustomer
     *
     * @param request 查询参数
     * @return 插入的条数
     */
    int insert(DealerCustomer request);

    /**
     * 批量插入DealerCustomer
     *
     * @param requests 批量查询参数
     * @return 批量插入的条数
     */
    int insertBatch(List<DealerCustomer> requests);

    /**
     * 单条DealerCustomer更新
     *
     * @param request 更新查询参数
     * @return 更新的条数
     */
    int update(DealerCustomer request);

    /**
     * 通过ID删除数据
     *
     * @param id 主键ID
     * @return 删除的条数
     */
    int delete(Integer id);

    /**
     * 根据条件查询对象对象list列表
     *
     * @param request 查询参数
     * @return 查询结果
     */
    List<DealerCustomer> getListByParam(DealerCustomer request);

    /**
     * 根据条件查询对象分页对象
     *
     * @param request 查询参数
     * @return 查询结果
     */
    Page<DealerCustomer> getPageByParam(DealerCustomer request, RowBounds rowBounds);

    /**
     * 根据条件查询单个对象
     *
     * @param request 查询参数
     * @return 返回结果
     */
    DealerCustomer getOneByParam(DealerCustomer request);

    List<DealerCustomer> checkDealerCustomerPhone(DealerCustomer dealerCustomer);

    List<DealerCustomer> checkDealerCustomerOneId(DealerCustomer dealerCustomer);


    /**
     * 总部跟进未绑定客户列表
     * @param cusUnbindRequest
     * @return
     */
    List<CusUnbindResponse> findOemCusUnbind (CusUnbindRequest cusUnbindRequest);

    /**
     * 经销商跟进未绑定客户列表
     * @param cusUnbindRequest
     * @return
     */
    List<CusUnbindResponse> findDealerCusUnbind(CusUnbindRequest cusUnbindRequest);

    /**
     * 获取客户转线索的数量
     * add by zly
     * 2022-01-15
     * @param clueDataRequest
     * @return
     */
    Long getEmpBindCount(ClueIntentionGradeDataRequest clueDataRequest);

    DealerCustomer getCustomerInfoWithPhone(QueryCustomerRequest request);
}